package com.zlfund.cat.zjgsmk.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by chenj
 * Created on 2017/8/14
 */

public class ViewpagerFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> mList;
    public ViewpagerFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList == null ? 0 : mList.size();
    }

    public void setList(List<Fragment> list){
        mList = list;
        notifyDataSetChanged();
    }
}
